import pdtec.ecco.inst.HeaderInfo;
import pdtec.ecco.inst.InstApplication;
import pdtec.ecco.inst.Instance;
import pdtec.ecco.inst.PopulationIterator;
import pdtec.ecco.inst.Value;
import pdtec.ecco.meta.EccoException;
import pdtec.ecco.meta.Entity;
import pdtec.ecco.meta.Schema;
import pdtec.ecco.meta.Type;


public class TestECCO {
	
	public static void main(String[] args){
	//	MFHA_OUT_INTERFACE new_MFHA_OUT_INTERFACE= new MFHA_OUT_INTERFACE();
		try {
			InstApplication app=new InstApplication("prog");
			Schema sh= Schema.get(app.getId()," MFHA_graph_schema" );
			Entity mfha_out_interface = (Entity) Type.getByName(app.getId(), sh.getName(),
					"MFHA_OUT_INTERFACE");
			HeaderInfo entete_instances = new HeaderInfo();
			app.readFile("notrespf", app.P21_CC1, false, entete_instances);
			PopulationIterator instances_mfha_out_interface= new PopulationIterator(mfha_out_interface);
			int nb_mfha_out_interface = 0;
			instances_mfha_out_interface.reset();
			while (!instances_mfha_out_interface.end()) {
			// calcul du nombre d'instances
			nb_mfha_out_interface++;
			instances_mfha_out_interface.next();
			}
			System.out.println("Nombre d'instances d'atome : " + nb_mfha_out_interface);
			System.out.println("Lecture de la première instance atome");
			instances_mfha_out_interface.reset();
			if (nb_mfha_out_interface>0) {
				Value val;
//				Instance_defaut instance = new Instance_defaut(instances_mfha_out_interface.current());
//				new_MFHA_OUT_INTERFACE.setAttr(instance.attr(app,"name").getString());

			}
			




		} catch (EccoException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
}
